﻿using System;
using MassIntellect.Drawing;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using MassIntellect.WorkIt.Presentation;

namespace MassIntellect.Presentation
{
	public class ActiveShape : Shape, IActiveElement
    {
        public ActiveShape() { }

        #region IActiveElement Members

        private ActiveElement ae = new ActiveElement();

        public bool AllowDrop
        {
            get { return ae.AllowDrop; }
            set { ae.AllowDrop = value; }
        }

        public DragEventHandler DragDrop
        {
            get
            {
                return ae.DragDrop;
            }
            set
            {
                ae.DragDrop = value;
            }
        }

        public DragEventHandler DragEnter
        {
            get
            {
                return ae.DragEnter;
            }
            set
            {
                ae.DragEnter = value;
            }
        }

        public EventHandler DragLeave
        {
            get
            {
                return ae.DragLeave;
            }
            set
            {
                ae.DragLeave = value;
            }
        }

        public DragEventHandler DragOver
        {
            get
            {
                return ae.DragOver;
            }
            set
            {
                ae.DragOver = value;
            }
        }

        public GiveFeedbackEventHandler GiveFeedback
        {
            get
            {
                return ae.GiveFeedback;
            }
            set
            {
                ae.GiveFeedback = value;
            }
        }

        public EventHandler MouseCaptureChanged
        {
            get
            {
                return ae.MouseCaptureChanged;
            }
            set
            {
                ae.MouseCaptureChanged = value;
            }
        }

        public MouseEventHandler MouseClick
        {
            get
            {
                return ae.MouseClick;
            }
            set
            {
                ae.MouseClick = value;
            }
        }

        public MouseEventHandler MouseDoubleClick
        {
            get
            {
                return ae.MouseDoubleClick;
            }
            set
            {
                ae.MouseDoubleClick = value;
            }
        }

        public MouseEventHandler MouseDown
        {
            get
            {
                return ae.MouseDown;
            }
            set
            {
                ae.MouseDown = value;
            }
        }

        public EventHandler MouseEnter
        {
            get
            {
                return ae.MouseEnter;
            }
            set
            {
                ae.MouseEnter = value;
            }
        }

        public EventHandler MouseHover
        {
            get
            {
                return ae.MouseHover;
            }
            set
            {
                ae.MouseHover = value;
            }
        }

        public EventHandler MouseLeave
        {
            get
            {
                return ae.MouseLeave;
            }
            set
            {
                ae.MouseLeave = value;
            }
        }

        public MouseEventHandler MouseMove
        {
            get
            {
                return ae.MouseMove;
            }
            set
            {
                ae.MouseMove = value;
            }
        }

        public MouseEventHandler MouseUp
        {
            get
            {
                return ae.MouseUp;
            }
            set
            {
                ae.MouseUp = value;
            }
        }

        public MouseEventHandler MouseWheel
        {
            get
            {
                return ae.MouseWheel;
            }
            set
            {
                ae.MouseWheel = value;
            }
        }

        public void OnDragDrop(DragEventArgs e)
        {
            ae.OnDragDrop(e);
        }

        public void OnDragEnter(DragEventArgs e)
        {
            ae.OnDragEnter(e);
        }

        public void OnDragLeave()
        {
            ae.OnDragLeave();
        }

        public void OnDragOver(DragEventArgs e)
        {
            ae.OnDragOver(e);
        }

        public void OnGiveFeedback(GiveFeedbackEventArgs e)
        {
            ae.OnGiveFeedback(e);
        }

        public void OnMouseCaptureChanged()
        {
            ae.OnMouseCaptureChanged();
        }

        public void OnMouseClick(MouseEventArgs e)
        {
            ae.OnMouseClick(e);
        }

        public void OnMouseDoubleClick(MouseEventArgs e)
        {
            ae.OnMouseDoubleClick(e);
        }

        public void OnMouseDown(MouseEventArgs e)
        {
            ae.OnMouseDown(e);
        }

        public void OnMouseEnter()
        {
            ae.OnMouseEnter();
        }

        public void OnMouseHover()
        {
            ae.OnMouseHover();
        }

        public void OnMouseLeave()
        {
            ae.OnMouseLeave();
        }

        public void OnMouseMove(MouseEventArgs e)
        {
            ae.OnMouseMove(e);
        }

        public void OnMouseUp(MouseEventArgs e)
        {
            ae.OnMouseUp(e);
        }

        public void OnMouseWheel(MouseEventArgs e)
        {
            ae.OnMouseWheel(e);
        }

        #endregion

        public Shape Shape { get; private set; }

        public ActiveShape(Shape Shape)
        {
            this.Shape = Shape;
        }

        public override RectangleF Bounds
        {
            get
            {
                return Shape.Bounds;
            }
        }

        public override PointF Joint(PointF pnt)
        {
            return Shape.Joint(pnt);
        }

        public override Brush Brush
        {
            get
            {
                return Shape.Brush;
            }
            set
            {
                Shape.Brush = value;
            }
        }

        public override Color Color
        {
            get
            {
                return Shape.Color;
            }
            set
            {
                Shape.Color = value;
            }
        }

        public override void DrawToGraphics(Graphics gr)
        {
            Shape.DrawToGraphics(gr);
        }

        public override float Height
        {
            get
            {
                return Shape.Height;
            }
            set
            {
                Shape.Height = value;
            }
        }

        public override bool IsDrawingOwner
        {
            get
            {
                return Shape.IsDrawingOwner;
            }
            set
            {
                Shape.IsDrawingOwner = value;
            }
        }

        public override bool IsFilled
        {
            get
            {
                return Shape.IsFilled;
            }
            set
            {
                Shape.IsFilled = value;
            }
        }

        public override bool IsOutlining
        {
            get
            {
                return Shape.IsOutlining;
            }
            set
            {
                Shape.IsOutlining = value;
            }
        }

        public override bool IsVisible
        {
            get
            {
                return Shape.IsVisible;
            }
            set
            {
                Shape.IsVisible = value;
            }
        }

        public override float Opacity
        {
            get
            {
                return Shape.Opacity;
            }
            set
            {
                Shape.Opacity = value;
            }
        }

        public override Pen Pen
        {
            get
            {
                return Shape.Pen;
            }
            set
            {
                Shape.Pen = value;
            }
        }

        public override float Width
        {
            get
            {
                return Shape.Width;
            }
            set
            {
                Shape.Width = value;
            }
        }

        public override float X
        {
            get
            {
                return Shape.X;
            }
            set
            {
                Shape.X = value;
            }
        }

        public override float Y
        {
            get
            {
                return Shape.Y;
            }
            set
            {
                Shape.Y = value;
            }
        }

        public override string ToString()
        {
            return Shape.ToString();
        }

        public override GraphicsPath GraphicsPath
        {
            get { return Shape.GraphicsPath; }
        }

        public override bool Contains(PointF pnt)
        {
            return Shape.Contains(pnt);
        }

        public override object Clone()
        {
            return new ActiveShape((Shape)this.Shape.Clone());
        }
    }
}
